package com.crm.business.crm.service;

import com.alibaba.fastjson.JSONObject;
import com.crm.common.crm.entity.BO.CrmSearchParamsBO;
import com.crm.common.crm.entity.PO.BrokenLineDataParameter;
import com.crm.common.crm.entity.PO.CrmActivity;
import com.crm.common.crm.entity.VO.*;
import com.crm.common.ka.core.entity.BasePage;
import com.crm.common.ka.core.feign.crm.entity.BiParams;
import com.crm.common.crm.entity.BO.CrmSearchBO;
import java.util.List;
import java.util.Map;

public interface CrmInstrumentService {

    /**
     * 销售简报
     * @param biParams params
     * @return data
     */
    public JSONObject queryBulletin(BiParams biParams);

    /**
     * 销售简报的详情
     * @param biParams 参数
     * @return data
     */
    public BasePage<Map<String, Object>> queryBulletinInfo(BiInstrumentParams biParams);

    /**
     * 遗忘客户统计
     * @param biParams params
     * @return data
     */
    public JSONObject forgottenCustomerCount(BiParams biParams);

    /**
     * 销售漏斗
     * @param biParams params
     * @return data
     */
    public JSONObject sellFunnel(BiParams biParams);


    BasePage<Map<String, Object>> sellFunnelBusinessList(CrmSearchParamsBO crmSearchParamsBO);

    /**
     * 销售趋势
     * @param biParams params
     * @return data
     */
    public JSONObject salesTrend(BiParams biParams);

    /**
     * 数据汇总
     * @param biParams params
     * @return data
     */
    public JSONObject queryDataInfo(BiParams biParams);

    /**
     * 业绩指标
     */
    public JSONObject queryPerformance(BiParams biParams);

    BasePage<CrmActivity> queryRecordList(BiParams biParams);

    List<JSONObject> queryRecordCount(BiParams biParams);

    BasePage<Map<String, Object>> forgottenCustomerPageList(BiParams biParams);

    BasePage<Map<String, Object>> unContactCustomerPageList(BiParams biParams);

    DashBoardVO querySalesData(BiParams biParams) throws Exception;

    JSONObject queryStatisticsCurve(BrokenLineDataParameter brokenLineDataParameter);

    JSONObject queryPeriodsStatisticsData(BrokenLineDataParameter brokenLineDataParameter);

    /**
     * 查询市场部销售数据
     * @param biParams
     * @return
     * @throws Exception
     */
    MarketingDepartmentDashBoardVO queryMarketingDepartmentSalesData(BiParams biParams) throws Exception;

    /**
     * 查询每日表单数量
     * @param biParams
     * @return
     */
    JSONObject queryEverydayFormCount(BiParams biParams);

    JSONObject queryDataFromTransfer(BiParams biParams);

    /**
     * 查询销售部销售数据
     * @param biParams
     * @return
     * @throws Exception
     */
    SalesDepartmentDashBoardVO querySalesDepartmentSalesData(BiParams biParams) throws Exception;

    /**
     * 查询销售部仪表盘数据
     * @param biParams
     * @return
     * @throws Exception
     */
    public SalesDepartmentDashBoardDataVO querySalesDepartmentDashboard(BiParams biParams) throws Exception;

    /**
     * 查询每日成交数量
     * @param biParams
     * @return
     */
    JSONObject queryDaysDealCount(BiParams biParams);

    /**
     * 查看教学部销售数据
     * @param biParams
     * @return
     */
    TeachingDepartmentDashBoardVO queryTeachingDepartmentData(BiParams biParams);

    List<CrmContactsInstrumentTableData> queryTeachingDepartmentTableData(BiParams biParams);

    public SalesDepartmentDashBoardDataVO queryStatDataForClassData(BiParams biParams) throws Exception;

    /**
     * 线索总数
     * @param biParams
     * @return
     */
    public Map<String,Object> leadsStatis(BiParams biParams);

    /**
     * 总数统计
     * @param biParams
     * @return
     */
    public Map<String,Object> numStatis(BiParams biParams);

    /**
     * 金额统计
     * @param biParams
     * @return
     */
    public Map<String,Object> moneyStatis(BiParams biParams);

    /**
     * 金额排行
     * @param biParams
     * @return
     */
    public List<JSONObject> rankStatis(BiParams biParams);

}
